<?php


function getEnum($table, $field, $selected = False) 
{
    $select=False;
    $enum_array = array();
    
    $query = 'SHOW COLUMNS FROM `' . $table . '` LIKE "' . $field . '"';
    $result = mysql_query($query);
    $row = mysql_fetch_row($result);
    preg_match_all('/\'(.*?)\'/', $row[1], $enum_array);
    
    if(!empty($enum_array[1])) {
        // Shift array keys to match original enumerated index in MySQL
        foreach($enum_array[1] as $k => $v) {
            $enum_fields[$k+1] = $v;
            if($v == $selected) $select = $k+1;
        }
        return form_dropdown($field, $enum_fields, $select);
    }else{
        return array(); // Return an empty array to avoid possible errors/warnings
    }
}



function user_groups()
{
    # 100 reserved for logged in not from cookie see login.php 
    return array(
        '1' => 'Anybody',
        '2' => 'Guest Only',
        '3' => 'User',
        '10' => 'Billboard User',
        '11' => 'Mobile Ads Company',
        '20' => 'Actor',
        '999'=>'Admin'
        );
}


function security_quetions(){
    return array(
        'What is your best facial future' =>
        array('', 'Nose', 'Chin', 'Eyes', 'Cheeks', 'Lips', 'Forehead', 'Teeth', 'Eyebrows', 'Ears', 'Mouth', 'Earlobes', 'Mole', 'Birthmark', 'Shin'),
        'Which genre of books do you prefer' =>
        array('', 'Almanacs','Comic Books', 'Comic Strips', 'Cookbooks', 'Encyclopedias', 'Fairy Tales', 'Fantasy Novels', 'Fictional Books', 'Hollywood Novels', 'Horror Fiction', 'Manuscripts', 'Mythology Books', 'Non-Fiction', 'Plays', 'Poetry', 'Poems', 'Self-Help', 'Science Fiction Novels', 'Short Stories', 'Travel Books'),
        'Which Mickey character would you rather be' => 
        array('', 'Burt', 'Butch the Bulldog', 'Chipn Dale', 'Clarabelle Cow', 'Clara Cluck', 'Daisy Duck', 'Dinah the Dachshund', 'Donald Duck', 'Goofy', 'Horace Horsecollar', 'Huey', 'Dewey and Louie', 'Humphrey the Bear', 'J. Audobon Woodlore', 'Louie the Mountain Lion', 'Ludwig Von Drake', 'Mickey Mouse', 'Minnie Mouse', 'Mortimer Mouse', 'Pete', 'Pluto', 'Scrooge McDuck', 'Shelby'),
        'Your favorite Snow White dwarf' => 
        array('', 'Doc', 'Bashful', 'Sleepy', 'Dopey', 'Happy', 'Grumpy', 'Sneezy'),
        'Your favorite dance style' => 
        array('', 'Belly dance', 'Flamenco', 'Ballet', 'Waltz', 'Tango', 'Viennese Waltz', 'Foxtrot', 'Quickstep', 'Jive', 'Swing', 'C/W Polka', 'C/W Cha-Cha-Cha', 'C/W Two Step', 'C/W Waltz', 'Cha-Cha-Cha', 'Cumbia', 'Bachata', 'Bolero', 'Mambo', 'Merengue', 'Paso Doble', 'Punta', 'Rumba', 'Samba', 'Salsa', 'Passa Passa', 'Street wipe dance', 'Breakdancing', 'C-walking', 'Krumping', 'Funkstyles', 'Electric Boogie', 'Popping', 'Hip Hop'),
        'Your favorite Piano piece is from' => 
        array('', 'Frédéric Chopin', 'Joseph Haydn', 'Carl Philipp Emanuel Bach', 'Ludwig van Beethoven', 'Wolfgang Amadeus Mozart', 'Franz Schubert', 'Felix Mendelssohn Bartholdy', 'Robert Schumann', 'Franz Liszt', 'Charles-Valentin Alkan', 'Johannes Brahms', 'Edvard Grieg', 'Alexander Scriabin', 'Sergei Rachmaninoff', 'Modest Mussorgsky')
        );
    
}


?>
